import unittest
import OTabSettings
from StringIO import StringIO
from util import fs
class TestParseConfig(unittest.TestCase):
    def setUp(self):
        self.tearDown = fs.with_module_wd(__file__)
    def testParseConfig(self):
        self.assertEqual(OTabSettings.readParameters(StringIO(
            ''';; this is a comment
check_acrobat: yes
unix_pdf_viewer: acroread''')),
                         dict(check_acrobat='yes',unix_pdf_viewer='acroread',
                              ipa='textipa',angle='90', color='lightgray',
                              hand='ding{43}', mac_cell_relief='None'))
        self.assertEqual(OTabSettings.readParameters('settings.ini'),
                         dict(check_acrobat='yes',unix_pdf_viewer='acroread',
                              ipa='textipa',angle='90', color='lightgray',
                              hand='ding{43}', mac_cell_relief='None',
                              environment='table', debug='false'))
import unittest
import test_OTGrammar
import test_OTFile
import test_Interface
suite = unittest.TestSuite([unittest.TestLoader().loadTestsFromTestCase(test_OTGrammar.TestOTGrammar),
                            unittest.TestLoader().loadTestsFromTestCase(test_OTGrammar.TestTableau),
                            unittest.TestLoader().loadTestsFromTestCase(test_OTGrammar.TestRowTab),
                            unittest.TestLoader().loadTestsFromTestCase(test_OTGrammar.TestColTab),
                            unittest.TestLoader().loadTestsFromTestCase(test_OTFile.TestOTFile),
                            unittest.TestLoader().loadTestsFromTestCase(test_OTFile.TestExporter),
                            unittest.TestLoader().loadTestsFromTestCase(TestParseConfig),
                            unittest.TestLoader().loadTestsFromTestCase(test_Interface.TestGUITableau)])

if __name__=="__main__":
    unittest.TextTestRunner().run(suite)
